home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.1 / pnmconvol.1 < prev    next >
Text File  |  1995-07-25  |  3KB  |  67 lines

  1.  
  2.  
  3.  
  4.      ppppnnnnmmmmccccoooonnnnvvvvoooollll((((1111))))    XXXXEEEENNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((11113333 JJJJaaaannnnuuuuaaaarrrryyyy 1111999999991111))))     ppppnnnnmmmmccccoooonnnnvvvvoooollll((((1111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           pnmconvol - general MxN convolution on a portable anymap
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           ppppnnnnmmmmccccoooonnnnvvvvoooollll _c_o_n_v_o_l_u_t_i_o_n_f_i_l_e [_p_n_m_f_i_l_e]
  13.  
  14.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.           Reads two portable anymaps as input.  Convolves the second
  16.           using the first, and writes a portable anymap as output.
  17.  
  18.           Convolution means replacing each pixel with a weighted
  19.           average of the nearby pixels.  The weights and the area to
  20.           average are determined by the convolution matrix.  The
  21.           unsigned numbers in the convolution file are offset by
  22.           -maxval/2 to make signed numbers, and then normalized, so
  23.           the actual values in the convolution file are only relative.
  24.  
  25.           Here is a sample convolution file; it does a simple average
  26.           of the nine immediate neighbors, resulting in a smoothed
  27.           image:
  28.               P2
  29.               3 3
  30.               18
  31.               10 10 10
  32.               10 10 10
  33.               10 10 10
  34.  
  35.           To see how this works, do the above-mentioned offset: 10 -
  36.           18/2 gives 1.  The possible range of values is from 0 to 18,
  37.           and after the offset that's -9 to 9.  The normalization step
  38.           makes the range -1 to 1, and the values get scaled
  39.           correspondingly so they become 1/9 - exactly what you want.
  40.           The equivalent matrix for 5x5 smoothing would have maxval 50
  41.           and be filled with 26.
  42.  
  43.           The convolution file will usually be a graymap, so that the
  44.           same convolution gets applied to each color component.
  45.           However, if you want to use a pixmap and do a different
  46.           convolution to different colors, you can certainly do that.
  47.  
  48.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  49.           pnmsmooth(1), pnm(5)
  50.  
  51.      AAAAUUUUTTTTHHHHOOOORRRR
  52.           Copyright (C) 1989, 1991 by Jef Poskanzer.
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                           (printed 9/7/93)
  64.  
  65.  
  66.  
  67.